package com.bdqn.service;

import com.bdqn.mapper.SysRoleMapper;
import com.bdqn.pojo.SysRole;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class SysRoleServiceImpl implements SysRoleService {
    private static final Logger logger = LogManager.getLogger(SysUserServiceImpl.class);
    @Resource
    private SysRoleMapper sysRoleMapper;

    @Override
    public List<SysRole> getAll() {
        List<SysRole> all = sysRoleMapper.getAll();
        return all;
    }
    @Override
    public int add(String code, String roleName) {
        return sysRoleMapper.add(code,roleName);
    }

    @Override
    public int getCode(String code) {
        return sysRoleMapper.getCode(code);
    }
    @Override
    public int del(int role) {
        return sysRoleMapper.del(role);
    }


    @Override
    public SysRole getByID(String roleid) {
        return sysRoleMapper.getByID(roleid);
    }

    @Override
    public int upd(Integer id, String code, String roleName) {
        return sysRoleMapper.upd(id,code,roleName);
    }
}
